<template>
	<view>
		<view class="record_item" v-for="(item,index) in dataList" :key="index">
			<!-- <image class="img" src=""></image> -->
			<view class="cont">
				<view class="name">领取用户：{{item.fk_users_id}}</view>
				<view class="num">领取数量：{{item.num}}</view>
				<view class="num">备注：{{item.remarks}}</view>
				<view class="time">{{item.date_creation | formatTime}}</view>
			</view>
		</view>
		<sww-load-more :params="dataListParams"></sww-load-more>
	</view>
</template>

<script>
	import {
		pagingMixin
	} from '@/mixins/pagingMixin.js'
	import {
		formatDate,
	} from '@/utils/moment/index.js';
	export default {
		mixins: [pagingMixin],
		data() {
			return {
				cardId: null
			};
		},
		filters: {
			formatTime(val) {
				return formatDate(new Date(val), 'YYYY-MM-DD HH:mm:ss');
			}
		},
		onLoad(options) {
			if (options && options.id) {
				this.cardId = Number(options.id)
				this.$initPage()
			}
		},
		onReachBottom() {
			this._load_data()
		},
		methods: {
			$initPage() {
				this._init_data('GetUsersCardRecordList', {
					pk_id: this.cardId
				})
			}
		},
	};
</script>
<style>
	page {
		background-color: #F5F5F5;
	}
</style>
<style scoped lang="scss">
	.record_item {
		display: flex;
		align-items: center;
		border-bottom: 2rpx solid #f5f5f5;
		padding: 20rpx;
		background-color: #fff;

		.img {
			width: 150rpx;
			height: 150rpx;
			margin-right: 10rpx;
		}

		.cont {
			flex: 1;
			overflow: hidden;

			.name {
				font-weight: bold;
			}

			.num {
				font-size: 26rpx;
				margin-top: 10rpx;
			}

			.time {
				color: #999;
				font-size: 24rpx;
				text-align: right;
				margin-top: 6rpx;
			}
		}
	}
</style>
